<% readonly = (@record.readonly? or not @record.authorized_for?(:action => :update)) -%>
<% active_scaffold_config_for(@record.class).subform.columns.each :for => @record, :flatten => true do |column| %>
  <%
  next unless in_subform?(column, parent_record)
  column = column.clone
  column.ui_type = :select if column.association
  -%>
  <td>
    <% unless readonly -%>
      <%= render :partial => form_partial_for_column(column), :locals => { :column => column, :scope => scope } -%>
    <% else -%>
      <p><%= @record.send(column.name) -%></p>
    <% end -%>
  </td>
<% end -%>
  <td class="actions">
    <%= link_to_function as_('Remove'), 'this.up(".association-record").remove()', { :class => "destroy" } -%>
    <% unless @record.new_record? %>
    <input type="hidden" name="<%= "record#{scope}[id]" -%>" value="<%= @record.id -%>" />
    <% end -%>
  </td>

